import 'package:flutter/material.dart';
import 'package:flutter_ahj_app/base/utils/JUIKit/JText.dart';
import 'package:flutter_ahj_app/app/my/invoicing/chooseHeader/bean/FP_PresetInvoice_Bean.dart';

typedef VoidCallback = void Function();

class ItemView extends StatefulWidget {
  final VoidCallback voidCallback;
  final Data data;

  const ItemView({Key key, this.voidCallback, this.data}) : super(key: key);
  @override
  _ItemViewState createState() => _ItemViewState();
}

class _ItemViewState extends State<ItemView> {
  ///是否选中
  bool _isSelected = false;
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
      child: Card(
        child: ListTile(
          title: JText(widget.data?.invoiceName ?? ''),
          subtitle: JText(widget.data?.taxplayerNumber ?? ''),
          onTap: () => _selectEve(),
        ),
        // Column(
        //   crossAxisAlignment: CrossAxisAlignment.start,
        //   children: <Widget>[
        //     Row(
        //       children: <Widget>[
        //         // IconButton(
        //         // icon: Icon(
        //         //   _isSelected ? Icons.check_box : Icons.check_box_outline_blank,
        //         //   color:_isSelected ? SQColor.blue : SQColor.black_9B9B9B,
        //         // ),
        //         // onPressed: () => _selectEve()),
        //         Expanded(
        //             child: Padding(
        //               padding: const EdgeInsets.only(left: 15, top: 15,bottom: 8),
        //               child: JText(
        //           '许昌环保能源有限公司许昌垃圾焚烧公司许昌垃圾焚烧发…',
        //           maxLines: 1,
        //           overflow: TextOverflow.ellipsis,
        //           fontSize: 16,
        //           color: SQColor.textColorListTitle,
        //           fontWeight: FontWeight.bold,
        //         ),
        //             )),
        //       ],
        //     ),
        //     Padding(
        //       padding: const EdgeInsets.only(left: 15, bottom: 15),
        //       child: JText('纳税人识别号',
        //           color: SQColor.textColorListSubTitle,
        //           fontSize: 12,
        //           maxLines: 1,
        //           overflow: TextOverflow.ellipsis),
        //     ),
        //   ],
        // ),
      ),
    );
  }

  /// 选择
  _selectEve() {
    print('选择');

    if (widget.voidCallback != null) {
      widget.voidCallback();
    }
  }
}
